<template>
  <div>
    <img src="../../assets/error/403.png" style="height: 70%; width: 100%" />
  </div>
</template>

<script>
import router from "@/router";
import store from "@/store";

export default {
  data() {
    return {
      timer: "", //定时器
    };
  },
  mounted() {
    this.goHome();
  },
  beforeDestroy() {
    clearInterval(this.timer);
  },
  methods: {
    //3秒后进入跳转页面
    goHome() {
      this.timer = setInterval(() => {
        router.push("home");
        let tabs = store.state.tabList;
        tabs.forEach((tab) => {
          if (tab.path === '/403') {
            tabs.splice(tabs.indexOf(tab), 1);
          }
        });
        store.state.tabList = tabs;
      }, 3000);
    },
  },
};
</script>

<style lang="css" scoped></style>
